SbVec2f plotSize;
SoNode* offscreenSep;

......

SoOffscreenRenderer offscreenRenderer(SbViewportRegion(1,1));
offscreenRenderer.setBackgroundColor(SbColor(1, 1, 1));
offscreenRenderer.setViewportRegion(SbViewportRegion(plotSize[0], plotSize[1]));
offscreenRenderer.render(offscreenSep);

{
	const SbViewportRegion &region = offscreenRenderer.getViewportRegion();
	const SbVec2s size = region.getViewportSizePixels();
	QImage image = QImage(size[0], size[1], QImage::Format_RGB32);

	QRgb *iBuffer = (QRgb*)image.bits();
	unsigned char *rBuffer = offscreenRenderer.getBuffer();

	for(int y = 0; y < size[1]; y++)
	{
		unsigned char *line = &rBuffer[3 * size[0] * (size[1] - y - 1)];
		for(int x = 0; x < size[0]; ++x)
		{
			*iBuffer++ = qRgb(line[0], line[1], line[2]);
			line += 3;
		}
	}
}